let arr = [1,2,3,1,2,-1,-2,1,2,-3,-5,6,2,1]

function maxChildArr(arr) {
    let max = arr[0]
    let res = 0, l = 1
    while(l < arr.length) {
        max = Math.max(max + arr[l], arr[l])
        res = Math.max(res, max)
    }
    return res
}